<!--
  To change this template, choose Tools | Templates
  and open the template in the editor.
-->

<%@ page contentType="text/html;charset=UTF-8" %>

<html>
  <head>
    <meta name="layout" content="main">
    <title>${facility?.name} Phone Numbers</title>
  </head>
  <body>
    <h2>${facility?.name} Phone Numbers</h2>
    </br>
    <table>
    <g:each var="number" in="${facility.phones}">
      <tr>
        <td align="right">${number.phoneType}:</td>
        <td style="padding-left: 10px">${number.number}</td>
        <td align="right" style="padding-left: 10px">
          <g:link action="deleteNumber" params="[name: facility.name, id: number.id]">Delete</g:link>
        </td>
      </tr>
    </g:each>
    </table>
    
    <g:form action="editNumbers">
      <g:hiddenField name="name" value="${facility.name}"/>
      <g:select name="phoneType" id="phoneType" from="${['Fax', 'Home', 'Work', 'Cell']}"
                        value="${telephoneNumber?.phoneType}"></g:select>
      <g:textField name="number" value="${telephoneNumber?.number}" />
      <g:submitButton name="phone" value="Add Number"/>
    </g:form>
  
    <g:link action="view" params="[name: facility.name]">Facility Page</g:link>
  </body>
</html>
